<!--#include file="./include/ControlHeader.inc"-->
<%@ Import Namespace="GUSNET" %>
<%@ Register TagPrefix="GUS" TagName="SysProfile" src=".\include\SysProfile.ascx" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.IO" %>

<script language="C#" runat="server">

public string ProductID = ""; 
public string CategoryID =""; 
public string[] ParentCategoryAry= new string[100];
public int ParentCategoryCnt = 0;

public string  ErrorMsgStr
	{
	  get
  		{    return ErrorMsg.Text; }
	  set
  		{    ErrorMsg.Text = value; }

	}
public string msg = "";
public string msgH= "";
public string SysReq="";
public string ProductImgFile = "";
public string Model = "";
public string ProductName = "";
public string ProductDesc = "";
public string CategoryName = "";


void Page_Load()
{
   ProductID = Request.QueryString["ProductID"]; 
   CategoryID = Request.QueryString["CategoryID"];

   if (ProductID == null) {ProductID="";}
   ProductID= ProductID.Trim();
   if (CategoryID == null) {CategoryID="";};
   CategoryID= CategoryID.Trim();
   
   MakeBibleBookList();
   if ( ! Page.IsPostBack ) {
	  Msg.Text = "<table><tr><td nowrap>" + msg + "</td></tr></table>"; // no use.
   } 
}



void MakeBibleBookList()
{
	string sql="";
	string CCat = "";
    GUSDBUtil g = new GUSDBUtil (SysProfile.DatabaseType, SysProfile.ConnectionString);
	SqlDataReader  dbr;
	int bShownNew = 0;
	
		sql = "SELECT Title_ID, Title_CN, Title_CNAB, Title_EN, Title_ENAB, Title_New FROM BibleTitle";
		 dbr = g.GetSQLDataReader(sql);
		  while (dbr.Read())
		  {
	  		//Response.Write(dbr.GetValue(1).ToString() + "<br>");
			if ((dbr.GetValue(5).ToString() == "1") && (bShownNew == 0)) {
				msg+="<tr><td bgcolor='#FFFF00'> New Testment </td></tr>";
				bShownNew = 1;
			}
			
			msg +="<tr><td>";
			msg += "<a href='ReadBible.aspx?TitleID="+ dbr.GetValue(0).ToString() +"'><img src='./images/Icon_Bible.gif' border=0> " + dbr.GetValue(1).ToString() + "</a>";
			msg+="</td></tr>";
		  } 
		  dbr.Close();
	//g.Close();


	
}



</script>
<GUS:SysProfile id="SysProfile" runat="server"/>

<asp:Label Id="ErrorMsg" RunAt="server" Visible="false" />

<style type="text/css">
<!--
.text-navbar {  font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9pt; font-style: normal; line-height: normal; font-weight: bold}
A:link	   {COLOR: #848484; TEXT-DECORATION: none;font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9pt; font-style: normal; line-height: normal;}
A:visited  {COLOR: #848484; TEXT-DECORATION: none;font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9pt; font-style: normal; line-height: normal;}
A:hover    {COLOR: #FF9900; TEXT-DECORATION: none;font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9pt; font-style: normal; line-height: normal;}
A:active   {COLOR: #996666; TEXT-DECORATION: none;font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9pt; font-style: normal; line-height: normal;}
a.link:active {  color: #222222; text-decoration:none}
a.link:hover {  color: #222222; text-decoration:none}
a.link:link {  color: #222222; text-decoration:none}
a.link:visited {  color: #222222; text-decoration:none}
-->
</style>


<table  border="0" cellspacing="0" cellpadding="0" width=150>
  <tr>
    <td height="100"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" nowrap>
        <tr bgcolor="#FFFFFF"> 
          <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<asp:Label Id="Msg" RunAt="server" Visible="False" />
			<%= msg %>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
